package io.renren.modules.orginfo.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.orginfo.dao.OrginfoDao;
import io.renren.modules.orginfo.entity.OrginfoEntity;
import io.renren.modules.orginfo.service.OrginfoService;


@Service("orginfoService")
public class OrginfoServiceImpl extends ServiceImpl<OrginfoDao, OrginfoEntity> implements OrginfoService {
    @Autowired
    OrginfoDao orginfoDao;

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<OrginfoEntity> page = this.page(
                new Query<OrginfoEntity>().getPage(params),
                new QueryWrapper<OrginfoEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<OrginfoEntity> getOrg(String orgName) {
        return orginfoDao.getOrg(orgName);
    }

}